#pragma once
#include "frame.h"

class FrameState : public Frame
{
  public:
    enum class GearFeedback
    {
        gear_N = 0b000,
        gear_centeer_veer = 0b001,
        gear_D = 0b010,
        gear_R = 0b011,
        gear_P = 0b100
    };
    enum class SteeringState
    {
        front_axle_steering = 0x00,
        diagonal_steering = 0x02,
        small_radius_steering = 0x01,
        center_steering = 0x03
    };
    enum class EmergencyMode
    {
        close = 0,
        open = 1
    };
    enum class ControlMode
    {
        standby = 0b00,
        remote_control_mode = 0b01,
        autonomous_mode = 0b10
    };

  public:
    float speed;
    float this_mileage;
    float total_mileage;
    float current_speed_limit;
    GearFeedback gear_feedback;
    SteeringState steering_state;
    EmergencyMode emergency_mode;
    ControlMode control_mode;

  public:
    explicit FrameState(QObject *parent = nullptr);
    ~FrameState() = default;
    QByteArray EncodeToBytes() const;
    void DecodeFromBytes(const QByteArray &data);
    QString GetFrameName() const;
};